package cn.edu.xmu.oomall.customer.mapper.jpa;

import cn.edu.xmu.oomall.customer.mapper.po.CouponPo;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.Optional;

/**
 * @author Suave
 * @date 2024/12/20
 */
@Repository
public interface CouponPoMapper extends JpaRepository<CouponPo,Long> {
    Page<CouponPo> findByCustomerIdAndUsed(Long customerId, Byte used, Pageable pageable);

    Optional<CouponPo> findByActivityIdAndCustomerId(Long activityId, Long customerId);
}
